package com.snopy.ribbon;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author snopy
 * @version 1.0.0
 * @classname RibbonConsumerApplication
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/10 17:20
 */
@SpringBootApplication
//@EnableDiscoveryClient
public class RibbonConsumerApplication {
    @Bean
    @LoadBalanced
    public RestTemplate rigistry(){
        return new RestTemplate();
    }
    public static void main(String[] args) {
        //new SpringApplicationBuilder(RibbonConsumerApplication.class).web(WebApplicationType.SERVLET).run(args);
        SpringApplication.run(RibbonConsumerApplication.class,args);
    }
}
